﻿using System;
using System.Collections.Generic;
using System.Text;
using Silvermoon.UI;
using Silvermoon.Windows;
using Silvermoon.Animations;

namespace Silvermoon.Controls
{
    public static class ToggleSwitchManagers
    {
        public static readonly VisualStateManager MetroToggleSwitchManager = new VisualStateManager(
             new VisualStateGroup(
                 new VisualState(VState.Enabled, 300),
                 new VisualState(VState.Disabled, new IntTransition(ToggleSwitch.ButtonOpacityProperty, 300, null, 0, PowerEase.Out))
             ),

             new VisualStateGroup(
                 new VisualState(VState.Unchecked,
                     new IntTransition
                     {
                         Property = ToggleSwitch.OffsetProperty,
                         To = 0,
                         Duration = 300,
                         Tracking = TrackMode.Keep
                     }
                 ),
                 new VisualState(VState.Checked,
                     new IntTransition
                     {
                         Property = ToggleSwitch.OffsetProperty,
                         To = ToggleSwitch.MaxOffset,
                         Duration = 300,
                         Tracking = TrackMode.Keep
                     }
                 )
             )
            );

        public static readonly VisualStateManager ToggleSwitchManager = new VisualStateManager(
             new VisualStateGroup(
                 new VisualState(VState.Enabled, 300),
                 new VisualState(VState.Disabled, new IntTransition(ToggleSwitch.ButtonOpacityProperty, 300, null, 0, PowerEase.Out))
             ),

             new VisualStateGroup(
                 new VisualState(VState.Unchecked,
                     new IntTransition
                     {
                         Property = ToggleSwitch.OffsetProperty,
                         To = 0,
                         Duration = 300,
                         Tracking = TrackMode.Keep
                     }
                 ),
                 new VisualState(VState.Checked,
                     new IntTransition
                     {
                         Property = ToggleSwitch.OffsetProperty,
                         To = ToggleSwitch.MaxOffset,
                         Duration = 300,
                         Tracking = TrackMode.Keep
                     }
                 )
             )
             , new VisualStateGroup(
                 new VisualState(VState.Normal, 400),
                 new VisualState(VState.Pressed,
                      new ColorTransition
                      {
                          To = PhoneColors.Blue,
                          Property = ToggleSwitch.ButtonColorProperty,
                          Duration = 5,
                      }
                 )
             )
          );
    }
}
